<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>发表文章</title>
	<link rel="stylesheet" href="js/jquery-ui/themes/base/all.css">
	<style>
	.u td{
			border:solid 1px #ccc;
			height:30px;
			border:0;
		}
		.tx{font-size: 15px;color:blue;}
		#title{color:red;font-size: 20px}
	</style>
	<script src="js/jquery.js"></script>
	<script>

		function changetypeName(){
			var typeName = $(":selected").html();
			$("#typeName").val(typeName);
		}
		function init(){
			$.ajax({
				url:'listSysArticleType.do',
				type:'post',
				dataType:'json',
				data:{},
				async:true,
				success:function(list){
					for(var i = 0;i<list.length;i++){
						$("#sysArticleTypeId").append('<option value='+list[i].sysArticleTypeId+'>'+list[i].typeName+'</option>');
					}
				}
			});
		}
		init();
		
	</script>
</head>
<body>
<form action="publishArticle.do" method="post" target="_parent">
	<table class="u">
		<tr>
			<td id="title">标题</td>
			<td>
			<input type="text" name="title" onchange="titleValidate(this.value)">
			</td>
		</tr>
		<tr>
			<td id="title">分类</td>
			<td><input id="typeName" type="hidden" name="typeName" value="${typeName }">
				<select name="ST.sysArticleTypeId" id="sysArticleTypeId" onchange="changetypeName()">
				</select>
			</td>
		</tr>
		<tr>
			<td id="title">内容</td>
			<td>
			<textarea name="articleContent" cols="60" rows="10" maxlength="1000" class="tx"></textarea>
			</td>
		</tr>
	</table>
	${msg }
	<input type="submit" value="发表">
</form>
</body>
</html>